<template>
  <div class="content_box">
    <div class="steps_box">
      <div class="nr">
        <div class="box">
          <p class="num">1</p>
          <p class="text">创建店铺</p>
        </div>
        <div class="line_box">
          <p class="line"></p>
        </div>
        <div class="box on">
          <p class="num">2</p>
          <p class="text">创建成功</p>
        </div>
      </div>
    </div>
    <div class="nr_box">
      <p class="icon"><van-icon name="success" /></p>
      <p class="title">恭喜！创建成功</p> 
      <p class="text">欢迎加入杠小二，在这里将开启你的梦想之旅！赶快去看看吧!</p>
    </div>
    <div class="anniu_box">
      <p @click="toHome">店铺首页</p>
      <p @click="changeStore">切换新店铺</p>
    </div>
  </div>
</template>

<script>
import { areaList } from '@vant/area-data';

import {
  selectMyStore
} from "@/api/index";
export default {
  components: {},
  data() {
    return {
      showCity:false,
      areaList,
      array:[
        {
          type:1,
          name:'指定金额券'
        },
        {
          type:2,
          name:'区间折扣券'
        },
        {
          type:3,
          name:'满减券'
        }
      ],
      storeId:''
    };
  },
  onShow() {},

  methods: {

    // 切换新店铺
    changeStore(){
      this.$showLoading("跳转中...")
      selectMyStore({storeId:this.storeId}).then(res=>{
        if(res.statusCode == '00000'){
          setTimeout(() => {
            wx.switchTab({
              url: `/pages/home/main`,
            });
          }, 1000);
        }else{
          wx.hideLoading()
        }
      })
    },
    closeCityPop(){
      this.showCity = false
    },

    // 跳转首页
    toHome(){
      this.$showLoading("跳转中...")
      setTimeout(() => {
        wx.switchTab({
          url: `/pages/home/main`,
        });
      }, 1000);
    }
  },
  onLoad(options) {
    console.log(options)
    this.storeId = options.storeId
  },
  onHide() {},

  onUnload() {},
};
</script>

<style lang="scss" scoped>
.content_box{
  min-height: 100vh;
  background: #F7F7F7;
  .steps_box{
    padding:0 30rpx;
    height: 228rpx;
    background: #0274F1;
    .nr{
      height: 120rpx;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .box{
      display: flex;
      align-items: center;
      .num{
        width: 40rpx;
        height: 40rpx;
        line-height: 40rpx;
        background: rgba(255,255,255,0.6);
        border-radius: 50%;
        font-size:30rpx;
        font-weight: 600;
        color:#0274F1;
        text-align: center;
      }
      .text{
        font-size:32rpx;
        color: rgba(255,255,255,0.6);
        font-weight: 600;
        margin-left:12rpx;
      }
      &.on{
        .num{
          background: rgba(255,255,255,1);
        }
        .text{
          color: rgba(255,255,255,1);
        }
      }
    }
    .line_box{
      width: 240rpx;
      height: 6rpx;
      background: rgba(255,255,255,0.4);
      border-radius: 4rpx;
      position: relative;
      .line{
        position: absolute;
        width: 240rpx;
        height: 6rpx;
        left: 0;
        top:0;
        background: #fff;
        border-radius: 4rpx;
      }
    }
  }
}
.nr_box{
  margin:-100rpx 30rpx 0 30rpx;
  background: #fff;
  padding:0 30rpx;
  box-shadow: 0px 0px 16px 0px rgba(0,0,0,0.1);
  border-radius: 16rpx;
  padding-top:80rpx;
  padding-bottom:74rpx;
  text-align: center;
  .icon{
    width: 136rpx;
    height: 136rpx;
    background: #0274F1;
    border-radius: 50%;
    margin:0 auto;
    color:#fff;
    font-size:88rpx;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .title{
    font-size:36rpx;
    font-weight: bold;
    color:#222;
    margin:48rpx 0 80rpx 0;
  }
  .text{
    font-size:28rpx;
    color:#222;
    width: 80%;
    margin:0 auto;
  }
}
.anniu_box{
  margin:50rpx 30rpx;
  display: flex;
  justify-content: space-between;
  p{
    box-shadow: 0rpx 10rpx 20rpx #CEDBFA;
    border:none;
    width: 46%;
    height: 88rpx;
    line-height: 88rpx;
    background: #0274F1;
    border-radius: 100rpx;
    text-align: center;
    color: #fff;
    font-size: 30rpx;
    font-weight: 500;
    border:1px solid transparent;
    &:first-child{
      background: none;
      border:1px solid #0274F1;
      color:#0274F1;
    }
  }
}
</style>
